package com.apimarket.entity;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Table;
import java.util.Date;

/**
 * @Description:
 * @Author ZXR
 * @Date 2021/7/20 9:21
 * @Version 1.0
 */

@Data
@Table(name = "sys_user")
public class SysUser {
    private Integer id;
    @Column(name = "user_name")
    private String userName;
    private String password;
    //mysql中没有直接定义成Boolean这种数据类型.它只能定义成 tinyint(1) ;
    //true代表1，false代表2
    private Boolean gender;
    private String telephone;
    private String email;
    @Column(name="last_login_time")
    private Date lastLoginTime; //上一次登录时间
    private Boolean enabled; //账号是否可用。默认为1（可用）
    @Column(name="not_expired")
    private Boolean notExpired; //是否过期。默认为1（没有过期）
    @Column(name="account_not_locked")
    private Boolean accountNotLocked; //账号是否锁定。默认为1（没有锁定）
    @Column(name="credentials_not_expired")
    private Boolean credentialsNotExpired; //证书（密码）是否过期。默认为1（没有过期）
    @Column(name="create_time")
    private Date createTime; //创建时间
    @Column(name="update_time")
    private Date updateTime; //更新时间
    private String kongId;
    private String roleNames;

    public SysUser(String userName, String password, Boolean gender, String telephone, String email)
    {
        this.userName=userName;
        this.password=password;
        this.gender=gender;
        this.telephone=telephone;
        this.email=email;
        this.enabled=true;
        this.notExpired=true;
        this.accountNotLocked=true;
        this.credentialsNotExpired=true;
    }
}
